package work20241207_chap8.r_demo15;

/**
 * @author zdl
 * @date 2024/12/5
 */
public class BasePlusSalesEmployee extends SalesEmployee {
    private double baseSalary;
    static final double OVERTIMESAL = 1000; //加班费
    @Override
    public double getSalary(int month) {
        if (this.getMonth() == month) {
            double s = baseSalary + getRate() * getRate();
            return s + 100 +OVERTIMESAL;
        } else {
            return baseSalary + (getRate() * getRate()) + OVERTIMESAL;
        }
    }

    public BasePlusSalesEmployee(double sales, double rate, double baseSalary) {
        super(sales, rate);
        this.baseSalary = baseSalary;
    }

    public BasePlusSalesEmployee(String name, int month, double sales, double rate, double baseSalary) {
        super(name, month, sales, rate);
        this.baseSalary = baseSalary;
    }

    public double getBaseSalary() {
        return baseSalary;
    }

    public void setBaseSalary(double baseSalary) {
        this.baseSalary = baseSalary;
    }
}
